package com.xinjiang.electricpower.feign.controller;

import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.xinjiang.electricpower.feign.service.IRemoteDictService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;

/**
 * 数据字典信息
 *
 * @author ruoyi
 */
@RestController
@RequestMapping("/dict/data")
@Api(value = "查询字典值", tags = "查询字典值")
@RequiredArgsConstructor
public class SysDictDataController extends BaseController {

    private final IRemoteDictService dictTypeService;

    /**
     * 根据字典类型查询字典数据信息
     */
    @GetMapping(value = "/type/dictType")
    @ApiOperation(value = "查询字典值", notes = "查询字典值")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "dictType", value = "字典类型", paramType = "query" ,required = true,dataType = "string",dataTypeClass = java.lang.String.class),
    })
    public AjaxResult dictType(@NotNull String dictType) {
        return dictTypeService.selectDictDataByType(dictType);
    }


}
